using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;
using Relay;
using Microsoft.Xna.Framework.Graphics;

namespace SolusMain
{
	public class Game : Microsoft.Xna.Framework.Game
	{
		GraphicsDeviceManager graphics;

		public Game ()
		{
			graphics = new GraphicsDeviceManager(this);
			graphics.CreateDevice();
			IsMouseVisible = true;
			Window.Title = "Solus --prototype";
		}

		protected override void Initialize()
		{
			RelayEngine.Instance.Initialize(this, graphics);
			base.Initialize();
		}

		protected override void LoadContent ()
		{
			base.LoadContent ();
		}

		protected override void UnloadContent ()
		{
			base.UnloadContent ();
		}

		protected override void Update (GameTime gameTime)
		{
			if (Keyboard.GetState ().IsKeyDown (Keys.Escape))
			{
				this.Exit();
			}

			RelayEngine.Instance.Update(gameTime);

			base.Update (gameTime);
		}

		protected override void Draw (GameTime gameTime)
		{
			//GraphicsDevice.Clear(Color.CornflowerBlue);

			RelayEngine.Instance.Draw(gameTime);

			base.Draw (gameTime);
		}
	}
}

